from db import db
from db import BaseFul
from db.app_user.app_user_tb import App_user
from db.songs.songs import Song
from sqlalchemy.orm import relationship


class User_like(BaseFul):
    user_id = db.Column(db.Integer, db.ForeignKey(App_user.id, ondelete='set null'))
    song_id = db.Column(db.Integer, db.ForeignKey(Song.id, ondelete='set null'))
    user = relationship(App_user, primaryjoin='User_like.user_id==App_user.id', backref='user_like')
    song = relationship(Song, primaryjoin='User_like.songs_id==Song.id', backref='user_like')
